﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar;
using RM2012Server.Controller;
using RM2012Server.Business;
using System.Windows.Forms.DataVisualization.Charting;

namespace RM2012Server.View
{
    public partial class frmBusiness : Office2007Form
    {
        #region Fields
        InvoiceCtrl m_InvoiceCtrl = new InvoiceCtrl();
        InvoiceDetailCtrl m_InvoiceDetailCtrl = new InvoiceDetailCtrl();
        InventoryCtrl m_InventoryCtrl = new InventoryCtrl();
        InventoryDetailCtrl m_InventoryDetailCtrl = new InventoryDetailCtrl();
        CustomerCtrl m_CustomerCtrl = new CustomerCtrl();
        UnitCtrl m_UnitCtrl = new UnitCtrl();
        MenuCtrl m_MenuCtrl = new MenuCtrl();
        #endregion

        #region Constructor
        public frmBusiness()
        {
            InitializeComponent();
        }
        #endregion

        #region Load
        private void frmBusiness_Load(object sender, EventArgs e)
        {
            cmbMonth.SelectedIndex = 0;
            txtYear.Text = DateTime.Now.Year.ToString();
            lblTopMenu.Text = "";
            lblInvoicePaid.Text = "";
            lblInvoiceTotal.Text = "";
            lblCountInvoice.Text = "";
            lblInventoryTotal.Text = "";
            lblBanNhapkho.Text = "";
            lblThuNhapkho.Text = "";
        }
        #endregion

        #region Event Handles
        private void btnMonth_Click(object sender, EventArgs e)
        {
            lblMonth.Text = cmbMonth.SelectedItem.ToString();
            double totalMonth = GetInvoiceTotalMonth(Convert.ToInt32(lblYear.Text), Convert.ToInt32(lblMonth.Text));
            double paidMonth = GetInvoicePaidMonth(Convert.ToInt32(lblYear.Text), Convert.ToInt32(lblMonth.Text));
            int countInvoice = GetCountInvoiceMonth(Convert.ToInt32(lblYear.Text), Convert.ToInt32(lblMonth.Text));
            lblInvoiceTotal.Text = totalMonth.ToString() + " VNĐ";
            lblInvoicePaid.Text = paidMonth.ToString() + " VNĐ";
            lblCountInvoice.Text = countInvoice.ToString() + " lượt";
            lblTopMenu.Text = GetDataTopMenuMonth();
            double inventoryTotal = GetInventoryTotalMonth(Convert.ToInt32(lblYear.Text), Convert.ToInt32(lblMonth.Text));
            lblInventoryTotal.Text = inventoryTotal.ToString() + " VNĐ";
            double banNhapkho = totalMonth - inventoryTotal;
            double thuNhapkho = paidMonth - inventoryTotal;
            lblBanNhapkho.Text = banNhapkho.ToString() + " VNĐ";
            lblThuNhapkho.Text = thuNhapkho.ToString() + " VNĐ";
            PreInfo(thuNhapkho);
            btnDrawn.Enabled = false;
            btnPrediction.Enabled = true;
            if (btnDrawn.Enabled == false)
            {
                btn3D.Enabled = false;
                btn2D.Enabled = false;
                btnStyle.Enabled = false;
                lblMaximum.Enabled = false;
                btnAutoMaximum.Enabled = false;
                txtMaximum.Enabled = false;
                btnSetMaximum.Enabled = false;
                chartCollect.Series.Clear();
                chartCollect.Titles.Clear();
            }
        }

        private void btnYear_Click(object sender, EventArgs e)
        {
            lblMonth.Text = "1,2,3,4,5,6,7,8,9,10,11,12";
            double totalMonth = GetInvoiceTotalYear(Convert.ToInt32(lblYear.Text));
            double paidMonth = GetInvoicePaidYear(Convert.ToInt32(lblYear.Text));
            int countInvoice = GetCountInvoiceYear(Convert.ToInt32(lblYear.Text));
            lblInvoiceTotal.Text = totalMonth.ToString() + " VNĐ";
            lblInvoicePaid.Text = paidMonth.ToString() + " VNĐ";
            lblCountInvoice.Text = countInvoice.ToString() + " lượt";
            lblTopMenu.Text = GetDataTopMenuYear();
            double inventoryTotal = GetInventoryTotalYear(Convert.ToInt32(lblYear.Text));
            lblInventoryTotal.Text = inventoryTotal.ToString() + " VNĐ";
            double banNhapkho = totalMonth - inventoryTotal;
            double thuNhapkho = paidMonth - inventoryTotal;
            lblBanNhapkho.Text = banNhapkho.ToString() + " VNĐ";
            lblThuNhapkho.Text = thuNhapkho.ToString() + " VNĐ";
            PreInfo(thuNhapkho);
            btnDrawn.Enabled = true;
            btnPrediction.Enabled = true;
        }

        private void btnPrediction_Click(object sender, EventArgs e)
        {

        }

        private void txtYear_TextChanged(object sender, EventArgs e)
        {
            try
            {
                int year = Convert.ToInt32(txtYear.Text);
                lblYear.Text = year.ToString();
            }
            catch
            {
                lblYear.Text = "0";
            }
        }

        private void cmbMonth_SelectedIndexChanged(object sender, EventArgs e)
        {
            lblMonth.Text = cmbMonth.SelectedItem.ToString();
        }

        private void btnDrawn_Click(object sender, EventArgs e)
        {
            try
            {
                int year = Convert.ToInt32(txtYear.Text);
                List<ChartYearInfo> list = GetChartData(year);

                //Set Chart Title and Legend
                chartCollect.Series.Clear();
                chartCollect.Titles.Clear();
                chartCollect.Legends.Clear();
                chartCollect.Titles.Add("KINH DOANH NĂM " + year.ToString());
                chartCollect.Titles[0].Font = new System.Drawing.Font("Tahoma", 15, FontStyle.Bold);
                chartCollect.Legends.Add(new Legend("LegendDefault"));
                //Set AxisX, AxisY Title, Interval
                chartCollect.ChartAreas[0].AxisX.Title = "Tháng";
                chartCollect.ChartAreas[0].AxisY.Title = "Triệu VNĐ";
                chartCollect.ChartAreas[0].AxisY.Maximum = 100;
                chartCollect.ChartAreas[0].AxisY.Interval = 5;
                //Add Series
                Series seriesInvoiceTotal = new Series("Tổng bán");
                Series seriesInvoicePaid = new Series("Tổng thu");
                Series seriesInventoryTotal = new Series("Tổng chi");
                for (int i = 0; i < list.Count; i++)
                {
                    ChartYearInfo info = list[i];
                    //Invoice Total
                    DataPoint point = new DataPoint(i, info.InvoiceTotal / 1000000);
                    point.AxisLabel = info.Month;
                    point.ToolTip = String.Format("Tháng {0} có tổng bán là {1} triệu VNĐ", info.Month, info.InvoiceTotal / 1000000);
                    seriesInvoiceTotal.Points.Add(point);

                    //Invoice Paid
                    DataPoint point2 = new DataPoint(i, info.InvoicePaid / 1000000);
                    point2.AxisLabel = info.Month;
                    point2.ToolTip = String.Format("Tháng {0} có tổng thu là {1} triệu VNĐ", info.Month, info.InvoicePaid / 1000000);
                    seriesInvoicePaid.Points.Add(point2);

                    //Inventory Total
                    DataPoint point3 = new DataPoint(i, info.InventoryTotal / 1000000);
                    point3.AxisLabel = info.Month;
                    point3.ToolTip = String.Format("Tháng {0} có tổng chi là {1} triệu VNĐ", info.Month, info.InventoryTotal / 1000000);
                    seriesInventoryTotal.Points.Add(point3);
                }
                chartCollect.Series.Add(seriesInventoryTotal);
                chartCollect.Series.Add(seriesInvoicePaid);
                chartCollect.Series.Add(seriesInvoiceTotal);

                //Set Button Style
                btn3D.Enabled = true;
                btn2D.Enabled = false;
                btnStyle.Enabled = true;
                btnDrawn.Enabled = false;
                lblMaximum.Enabled = true;
                btnAutoMaximum.Enabled = true;
                txtMaximum.Enabled = true;
                btnSetMaximum.Enabled = true;
            }
            catch
            {
                MessageBoxEx.Show("Đã có lỗi xảy ra trong quá trình tạo biểu đồ. Xin vui lòng thực hiện lại !", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
        #endregion

        #region Public Method
        public double GetInvoiceTotal()
        {
            double result = 0.0;
            try
            {
                DataTable dtResult = m_InvoiceCtrl.GetAll();
                for (int i = 0; i < dtResult.Rows.Count; i++)
                {
                    result = result + Convert.ToDouble(dtResult.Rows[i]["Total"].ToString());
                }
            }
            catch
            {
                result = 0.0;
            }
            return result;
        }

        public double GetInvoicePaid()
        {
            double result = 0.0;
            try
            {
                DataTable dtResult = m_InvoiceCtrl.GetAll();
                for (int i = 0; i < dtResult.Rows.Count; i++)
                {
                    result = result + Convert.ToDouble(dtResult.Rows[i]["Paid"].ToString());
                }
            }
            catch
            {
                result = 0.0;
            }
            return result;
        }

        public int GetCountInvoiceYear(int year)
        {
            int result = 0;
            try
            {
                DataTable dtResult = m_InvoiceCtrl.GetByYear(year);
                result = dtResult.Rows.Count;
            }
            catch
            {
                result = 0;
            }
            return result;
        }

        public int GetCountInvoiceMonth(int year, int month)
        {
            int result = 0;
            try
            {
                DataTable dtResult = m_InvoiceCtrl.GetByMonth(year, month);
                result = dtResult.Rows.Count;
            }
            catch
            {
                result = 0;
            }
            return result;
        }

        public double GetInvoiceTotalYear(int year)
        {
            double result = 0.0;
            try
            {
                DataTable dtResult = m_InvoiceCtrl.GetByYear(year);
                for (int i = 0; i < dtResult.Rows.Count; i++)
                {
                    result = result + Convert.ToDouble(dtResult.Rows[i]["Total"].ToString());
                }
            }
            catch
            {
                result = 0.0;
            }
            return result;
        }

        public double GetInvoicePaidYear(int year)
        {
            double result = 0.0;
            try
            {
                DataTable dtResult = m_InvoiceCtrl.GetByYear(year);
                for (int i = 0; i < dtResult.Rows.Count; i++)
                {
                    result = result + Convert.ToDouble(dtResult.Rows[i]["Paid"].ToString());
                }
            }
            catch
            {
                result = 0.0;
            }
            return result;
        }

        public double GetInvoiceTotalMonth(int year, int month)
        {
            double result = 0.0;
            try
            {
                DataTable dtResult = m_InvoiceCtrl.GetByMonth(year, month);
                for (int i = 0; i < dtResult.Rows.Count; i++)
                {
                    result = result + Convert.ToDouble(dtResult.Rows[i]["Total"].ToString());
                }
            }
            catch
            {
                result = 0.0;
            }
            return result;
        }

        public double GetInvoicePaidMonth(int year, int month)
        {
            double result = 0.0;
            try
            {
                DataTable dtResult = m_InvoiceCtrl.GetByMonth(year, month);
                for (int i = 0; i < dtResult.Rows.Count; i++)
                {
                    result = result + Convert.ToDouble(dtResult.Rows[i]["Paid"].ToString());
                }
            }
            catch
            {
                result = 0.0;
            }
            return result;
        }

        public DataTable GetTopMenuMonth(int year, int month)
        {
            DataTable dt = m_InvoiceDetailCtrl.GetTopMenuMonth(year, month);
            return dt;
        }

        public DataTable GetTopMenuYear(int year)
        {
            DataTable dt = m_InvoiceDetailCtrl.GetTopMenuYear(year);
            return dt;
        }

        public String GetDataTopMenuMonth()
        {
            DataTable topMenu = GetTopMenuMonth(Convert.ToInt32(lblYear.Text), Convert.ToInt32(lblMonth.Text));
            String topMenuMonth = "";
            if (topMenu.Rows.Count >= 5)
            {
                for (int i = 0; i < 5; i++)
                {
                    String menuId = topMenu.Rows[i]["MenuId"].ToString();
                    DataTable dtMenu = m_MenuCtrl.GetById(menuId);
                    String menuName = dtMenu.Rows[0]["MenuName"].ToString();
                    String price = dtMenu.Rows[0]["Price"].ToString();
                    price = price.Substring(0, price.LastIndexOf("."));
                    DataTable dtUnit = m_UnitCtrl.GetById(dtMenu.Rows[0]["UnitId"].ToString());
                    String unitName = dtUnit.Rows[0]["UnitName"].ToString();
                    topMenuMonth = topMenuMonth + " - " + menuName + " (" + price + "/" + unitName + ")" + Environment.NewLine;
                }
            }
            else
            {
                for (int i = 0; i < topMenu.Rows.Count; i++)
                {
                    String menuId = topMenu.Rows[i]["MenuId"].ToString();
                    DataTable dtMenu = m_MenuCtrl.GetById(menuId);
                    String menuName = dtMenu.Rows[0]["MenuName"].ToString();
                    String price = dtMenu.Rows[0]["Price"].ToString();
                    price = price.Substring(0, price.LastIndexOf("."));
                    DataTable dtUnit = m_UnitCtrl.GetById(dtMenu.Rows[0]["UnitId"].ToString());
                    String unitName = dtUnit.Rows[0]["UnitName"].ToString();
                    topMenuMonth = topMenuMonth + " - " + menuName + " (" + price + "/" + unitName + ")" + Environment.NewLine;
                }
            }
            return topMenuMonth;
        }

        public String GetDataTopMenuYear()
        {
            DataTable topMenu = GetTopMenuYear(Convert.ToInt32(lblYear.Text));
            String topMenuMonth = "";
            if (topMenu.Rows.Count >= 5)
            {
                for (int i = 0; i < 5; i++)
                {
                    String menuId = topMenu.Rows[i]["MenuId"].ToString();
                    DataTable dtMenu = m_MenuCtrl.GetById(menuId);
                    String menuName = dtMenu.Rows[0]["MenuName"].ToString();
                    String price = dtMenu.Rows[0]["Price"].ToString();
                    price = price.Substring(0, price.LastIndexOf("."));
                    DataTable dtUnit = m_UnitCtrl.GetById(dtMenu.Rows[0]["UnitId"].ToString());
                    String unitName = dtUnit.Rows[0]["UnitName"].ToString();
                    topMenuMonth = topMenuMonth + " - " + menuName + " (" + price + "/" + unitName + ")" + Environment.NewLine;
                }
            }
            else
            {
                for (int i = 0; i < topMenu.Rows.Count; i++)
                {
                    String menuId = topMenu.Rows[i]["MenuId"].ToString();
                    DataTable dtMenu = m_MenuCtrl.GetById(menuId);
                    String menuName = dtMenu.Rows[0]["MenuName"].ToString();
                    String price = dtMenu.Rows[0]["Price"].ToString();
                    price = price.Substring(0, price.LastIndexOf("."));
                    DataTable dtUnit = m_UnitCtrl.GetById(dtMenu.Rows[0]["UnitId"].ToString());
                    String unitName = dtUnit.Rows[0]["UnitName"].ToString();
                    topMenuMonth = topMenuMonth + " - " + menuName + " (" + price + "/" + unitName + ")" + Environment.NewLine;
                }
            }
            return topMenuMonth;
        }

        public double GetInventoryTotalYear(int year)
        {
            double result = 0.0;
            try
            {
                DataTable dtResult = m_InventoryCtrl.GetImportYear(year);
                for (int i = 0; i < dtResult.Rows.Count; i++)
                {
                    result = result + Convert.ToDouble(dtResult.Rows[i]["Total"].ToString());
                }
            }
            catch
            {
                result = 0.0;
            }
            return result;
        }

        public double GetInventoryTotalMonth(int year, int month)
        {
            double result = 0.0;
            try
            {
                DataTable dtResult = m_InventoryCtrl.GetImportMonth(year, month);
                for (int i = 0; i < dtResult.Rows.Count; i++)
                {
                    result = result + Convert.ToDouble(dtResult.Rows[i]["Total"].ToString());
                }
            }
            catch
            {
                result = 0.0;
            }
            return result;
        }

        public void PreInfo(double numer)
        {
            if (numer < -1000000.0)
            {
                lblNotOK.Visible = true;
                picNotOK.Visible = true;
                lblWarning.Visible = false;
                picWarning.Visible = false;
                lblOK.Visible = false;
                picOK.Visible = false;
            }
            else if ((numer >= -1000000.0) && (numer <= 1000000.0))
            {
                lblNotOK.Visible = false;
                picNotOK.Visible = false;
                lblWarning.Visible = true;
                picWarning.Visible = true;
                lblOK.Visible = false;
                picOK.Visible = false;
            }
            else // > 1000000.0
            {
                lblNotOK.Visible = false;
                picNotOK.Visible = false;
                lblWarning.Visible = false;
                picWarning.Visible = false;
                lblOK.Visible = true;
                picOK.Visible = true;
            }
        }

        public List<ChartYearInfo> GetChartData(int year)
        {
            List<ChartYearInfo> list = new List<ChartYearInfo>();
            double m1_InvoiceTotal = GetInvoiceTotalMonth(year, 1);
            double m1_InvoicePaid = GetInvoicePaidMonth(year, 1);
            double m1_InventoryTotal = GetInventoryTotalMonth(year, 1);
            list.Add(new ChartYearInfo("1", m1_InvoiceTotal, m1_InvoicePaid, m1_InventoryTotal));

            double m2_InvoiceTotal = GetInvoiceTotalMonth(year, 2);
            double m2_InvoicePaid = GetInvoicePaidMonth(year, 2);
            double m2_InventoryTotal = GetInventoryTotalMonth(year, 2);
            list.Add(new ChartYearInfo("2", m2_InvoiceTotal, m2_InvoicePaid, m2_InventoryTotal));

            double m3_InvoiceTotal = GetInvoiceTotalMonth(year, 3);
            double m3_InvoicePaid = GetInvoicePaidMonth(year, 3);
            double m3_InventoryTotal = GetInventoryTotalMonth(year, 3);
            list.Add(new ChartYearInfo("3", m3_InvoiceTotal, m3_InvoicePaid, m3_InventoryTotal));

            double m4_InvoiceTotal = GetInvoiceTotalMonth(year, 4);
            double m4_InvoicePaid = GetInvoicePaidMonth(year, 4);
            double m4_InventoryTotal = GetInventoryTotalMonth(year, 4);
            list.Add(new ChartYearInfo("4", m4_InvoiceTotal, m4_InvoicePaid, m4_InventoryTotal));

            double m5_InvoiceTotal = GetInvoiceTotalMonth(year, 5);
            double m5_InvoicePaid = GetInvoicePaidMonth(year, 5);
            double m5_InventoryTotal = GetInventoryTotalMonth(year, 5);
            list.Add(new ChartYearInfo("5", m5_InvoiceTotal, m5_InvoicePaid, m5_InventoryTotal));

            double m6_InvoiceTotal = GetInvoiceTotalMonth(year, 6);
            double m6_InvoicePaid = GetInvoicePaidMonth(year, 6);
            double m6_InventoryTotal = GetInventoryTotalMonth(year, 6);
            list.Add(new ChartYearInfo("6", m6_InvoiceTotal, m6_InvoicePaid, m6_InventoryTotal));

            double m7_InvoiceTotal = GetInvoiceTotalMonth(year, 7);
            double m7_InvoicePaid = GetInvoicePaidMonth(year, 7);
            double m7_InventoryTotal = GetInventoryTotalMonth(year, 7);
            list.Add(new ChartYearInfo("7", m7_InvoiceTotal, m7_InvoicePaid, m7_InventoryTotal));

            double m8_InvoiceTotal = GetInvoiceTotalMonth(year, 8);
            double m8_InvoicePaid = GetInvoicePaidMonth(year, 8);
            double m8_InventoryTotal = GetInventoryTotalMonth(year, 8);
            list.Add(new ChartYearInfo("8", m8_InvoiceTotal, m8_InvoicePaid, m8_InventoryTotal));

            double m9_InvoiceTotal = GetInvoiceTotalMonth(year, 9);
            double m9_InvoicePaid = GetInvoicePaidMonth(year, 9);
            double m9_InventoryTotal = GetInventoryTotalMonth(year, 9);
            list.Add(new ChartYearInfo("9", m9_InvoiceTotal, m9_InvoicePaid, m9_InventoryTotal));

            double m10_InvoiceTotal = GetInvoiceTotalMonth(year, 10);
            double m10_InvoicePaid = GetInvoicePaidMonth(year, 10);
            double m10_InventoryTotal = GetInventoryTotalMonth(year, 10);
            list.Add(new ChartYearInfo("10", m10_InvoiceTotal, m10_InvoicePaid, m10_InventoryTotal));

            double m11_InvoiceTotal = GetInvoiceTotalMonth(year, 11);
            double m11_InvoicePaid = GetInvoicePaidMonth(year, 11);
            double m11_InventoryTotal = GetInventoryTotalMonth(year, 11);
            list.Add(new ChartYearInfo("11", m11_InvoiceTotal, m11_InvoicePaid, m11_InventoryTotal));

            double m12_InvoiceTotal = GetInvoiceTotalMonth(year, 12);
            double m12_InvoicePaid = GetInvoicePaidMonth(year, 12);
            double m12_InventoryTotal = GetInventoryTotalMonth(year, 12);
            list.Add(new ChartYearInfo("12", m12_InvoiceTotal, m12_InvoicePaid, m12_InventoryTotal));

            return list;
        }
        #endregion

        #region Chart Control
        private void btn3D_Click(object sender, EventArgs e)
        {
            chartCollect.ChartAreas[0].Area3DStyle.Enable3D = true;
            btn2D.Enabled = true;
            btn3D.Enabled = false;
        }

        private void btn2D_Click(object sender, EventArgs e)
        {
            chartCollect.ChartAreas[0].Area3DStyle.Enable3D = false;
            btn2D.Enabled = false;
            btn3D.Enabled = true;
        }

        private void btnAutoMaximum_Click(object sender, EventArgs e)
        {
            //Set AxisX, AxisY Title, Interval
            chartCollect.ChartAreas[0].AxisY.Dispose();
            chartCollect.ChartAreas[0].AxisY = new System.Windows.Forms.DataVisualization.Charting.Axis();
            chartCollect.ChartAreas[0].AxisY.Title = "Triệu VNĐ";
            chartCollect.ChartAreas[0].AxisY.Interval = 5;
        }

        private void txtMaximum_TextChanged(object sender, EventArgs e)
        {
            try
            {
                double dValue = Convert.ToDouble(txtMaximum.Text);
            }
            catch
            {
                txtMaximum.Text = "0";
            }
        }

        private void btnSetMaximum_Click(object sender, EventArgs e)
        {
            chartCollect.ChartAreas[0].AxisY.Maximum = Convert.ToDouble(txtMaximum.Text);
        }
        #endregion

        #region Chart Style
        private void btnStyleBar_Click(object sender, EventArgs e)
        {
            foreach(Series series in chartCollect.Series)
            {
                series.ChartType = SeriesChartType.Bar;
            }
        }

        private void btnStyleColumn_Click(object sender, EventArgs e)
        {
            foreach (Series series in chartCollect.Series)
            {
                series.ChartType = SeriesChartType.Column;
            }
        }

        private void btnStyleSpine_Click(object sender, EventArgs e)
        {
            foreach (Series series in chartCollect.Series)
            {
                series.ChartType = SeriesChartType.Spline;
            }
        }

        private void btnStyleSpineArea_Click(object sender, EventArgs e)
        {
            foreach (Series series in chartCollect.Series)
            {
                series.ChartType = SeriesChartType.SplineArea;
            }
        }

        private void btnStylePoint_Click(object sender, EventArgs e)
        {
            foreach (Series series in chartCollect.Series)
            {
                series.ChartType = SeriesChartType.Point;
            }
        }

        private void btnStylePie_Click(object sender, EventArgs e)
        {
            foreach (Series series in chartCollect.Series)
            {
                series.ChartType = SeriesChartType.Pie;
            }
        }

        private void btnStyleDoughnut_Click(object sender, EventArgs e)
        {
            foreach (Series series in chartCollect.Series)
            {
                series.ChartType = SeriesChartType.Doughnut;
            }
        }

        private void btnStylePyramid_Click(object sender, EventArgs e)
        {
            foreach (Series series in chartCollect.Series)
            {
                series.ChartType = SeriesChartType.Pyramid;
            }
        }

        private void btnStyleFunnel_Click(object sender, EventArgs e)
        {
            foreach (Series series in chartCollect.Series)
            {
                series.ChartType = SeriesChartType.Funnel;
            }
        }
        #endregion
    }
}
